home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.08 Aug 90 / Test Object Source / CDigitalControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-06  |  1.8 KB  |  63 lines  |  [TEXT/KAHL]

  1. /*************************************************
  2.  CDigitalControl.h
  3.  
  4.             Interface for the DigitalControl Class
  5.                          
  6.  © 1989 Enrico Colombini. All rights reserved.
  7. *************************************************/
  8. #define _H_CDigitalControl    /*include only once*/
  9.  
  10. #include <CPane.h>
  11. #include <CButton.h>
  12. #include <CBorder.h>
  13. #include <CStaticText.h>
  14.  
  15.      /*** class declaration: ***/
  16.  
  17. struct CDigitalControl : CPane {
  18.  
  19.         /* instance variables: */
  20.  
  21.     CButton    *dnBtn;            /*down/up buttons*/
  22.     CButton    *upBtn;
  23.     Rect            grayRect;        /*rect between buttons*/
  24.     CBorder    *border;            /*border around display*/
  25.     CStaticText    *disp;        /*digital display*/
  26.     short        value;                /*current value*/
  27.     short        minValue;        /*allowed limits*/
  28.     short        maxValue;
  29.     short        stepSlow;        /*sigle & lowspeed rate*/
  30.     short        stepFast;        /*high-speed step rate*/
  31.     short        threshold;    /*steps to rate change*/
  32.     short        firstDelay;    /*delay after 1st step*/
  33.     short        reptDelay;    /*after following steps*/
  34.     long            lastDown;        /*last mouse dn event*/
  35.     long            nextWhen;        /*time for next step*/
  36.     short         trackSpeed;    /*1=single,2=slow,3=fast*/
  37.     short        trackCount;    /*steps from spd change*/
  38.     long            displayCmd;    /*issue before display*/
  39.  
  40.         /* overridden methods: */
  41.         
  42.     void    Draw(Rect *area);                    /*draw object*/
  43.  
  44.         /* new methods: */
  45.  
  46.     void    IDigitalControl(                    /*init object*/
  47.                     short resID,
  48.                     CView *anEnclosure,
  49.                     CBureaucrat *aSupervisor);
  50.     void    TrackValue(CView *btn);    /*internal use*/
  51.     void    SetValue(short val);            /*set value*/
  52.     void    SetDisplayText(char *txt); /*displ. text*/
  53.     void    UpdateDisplayNow(void);    /*update displ.*/
  54.     void    SetMinValue(short val);    /*set low limit*/
  55.     void    SetMaxValue(short val);    /*set hi limit*/
  56.     void    SetSteps(                                    /*step rates*/
  57.                     short slow,short fast,
  58.                     short thr);                
  59.     void    SetDisplayCmd(long cmd);    /*set command*/
  60.     short GetValue(void);                    /*return value*/
  61. };
  62.  
  63.